home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Business Master (3rd Edition)
/
The Business Master (3rd Edition).iso
/
files
/
grapties
/
dmorf1
/
morf1.exe
/
DOWNLOAD
/
DMORF
/
1
/
DMORF.DOC
next >
Wrap
Text File
|
1993-04-08
|
10KB
|
250 lines
DMORF Rel 1.0 (04/08/93)
Copyright (c) 1992, 1993, by David K. Mason
DMorf (Dave's Morphing program) is a small morphing program that
runs in DOS graphics mode. It operates on TGA, GIF, and IMG
files, and produces a bunch of TGA files as output.
You can compile these TGA files with my other program, DTA, or
dump 'em straight out to video if you've got the hardware.
----------------------------------------------------------------------
Hardware requirements:
To run DMorf, you MUST have:
1) A VGA monitor (regular VGA is sufficient... if you're satisfied
with 640x480x16 mode... if you've got a VESA-compliant VGA board,
or a VESA driver, then DMorf will use 640x480x256 mode).
2) At least a '286
3) A mouse with a microsoft-compatible driver
4) At least *some* extended memory (expanded memory is not
useful). Lots of extended memory, unless you're working
with teeny pictures.
This program runs in '286 protected mode, and allows
access to up to 16M of extended memory.
( During the warping process, DMorf creates a buffer
big enough to hold one entire picture, in RGBa (32-bit)
form. That means 256000 bytes if you're working with
320x200 pictures, or 1,228,800 for 640x480, or 1,920,000
for 800x600, or 3,145,728 for 1024x768. )
To accomplish any serious work with this program, you SHOULD have:
1) A numeric coprocessor... it DRAGS without one
----------------------------------------------------------------------
DOS-Extender Files
The DOS-Extender Files from the Borland Pascal compiler (DPMI16BI.OVL,
RTM.EXE, and DPMIINST.EXE) must exist somewhere in your DOS path,
or in the same directory where you keep DMORF.EXE.
... or DMORF will not work at all. These files are in the DMorf
archive.
If you've got an unsupported 286 processor (you'll know, because
DMORF will complain loudly), then you'll have to:
(1) disable any memory management software you have running
(like HIMEM.SYS)
(2) run the other program in this archive, DPMIINST, which will
configure RTM.EXE for your system
and then
(3) turn any disabled memory managment stuff back on
----------------------------------------------------------------------
How to use DMorf:
To get started with DMorf, type "DMORF <file1> <file2>"
The files can be TGA (16, 24, or 32, compressed or uncompressed),
Vivid IMG, or GIF. The two files don't have to be in the same
format, but they do have to share the same dimensions.
DMorf will then read and display the two pictures in side-by-side
windows. If you only supplied one filename, then it'll display
that picture twice. It scales them so they'll fit in the windows.
Then, it lays a mesh over the two pictures.
In this program, a mesh is represented by a bunch of horizontal
and vertical lines. The points where they intersect can be
adjusted.
Initially, there are lines on the four edges of the picture,
There are always the same number of mesh points defined in the
two pictures, though they aren't always in the same places.
To add a new line to the mesh, move the mouse cursor to the
border around one of the pictures (which one doesn't particularly
matter). Click the *right* mouse button at the point where you want
the line added. (If the cursor is on the top or bottom border, a
vertical line will be added, and if it's on one of the sides, a
horizontal line will be added.)
To move a vertex, put the mouse cursor over the intersection
of two lines, press the button, and move the mouse.
Let go of the button when you've got the point where you want
it. DMorf will try to prevent you from overlapping lines.
It's possible to defeat it with weird angles. Don't do that...
it's bad.
The point of these meshes is to define the shapes of the objects
in the pictures. The lines should match the contours of any
objects in the scenes.
Move the vertices of the lines so that the lines match the curves
of the objects in the pictures. When you've got meshes that you're
satisfied with, click on the "Go" button and watch.
----------------------------------------------------------------------
The User Interface:
Here's what the other controls on the screen do:
Just Warp: In Morph mode, the program will map points from
picture #1 toward picture #2, and from 2 toward 1, and
cross-fade. In Warp mode, it'll just map points from
#1 toward #2, with no fade.
Not too surprisingly, Warp mode takes half the time
that Morph mode does.
Spline meshes:
When your points are all located where you want them to be,
and you tell DMorf to go ahead and morph, DMorf figures out
which points to map where by drawing spine curves between
the vertices.
If you turn this control off, it'll draw straight lines instead.
Reasons to use splines instead of lines: the warp often looks
a whole lot better.
Reasons to use lines instead of splines:
(1) Splines sometimes go haywire, with curves going every which
way, overlapping, and (gasp) sometimes even passing beyond
of the picture borders
(2) You don't want something curved when it warps
(3) lines are faster than splines.
Smooth resampling: In smooth mode, DMorf interpolates
new pixel values from all source pixels that should
contribute... if you turn this control off, it just
grabs a the closest pixel value.
Nearest neighbor, in other words. The results
in smooth mode look massively better than dumb mode.
But dumb mode is massively faster. Dumb mode would be
useful in test runs, but don't use it for real stuff, 'cause
it looks like crap.
The RLE Checkbox: Tells DMorf whether or not to create run-length
encoded (compressed) TGA files.
Compressed TGA files are almost always smaller than
non-compressed, but some programs can't read them.
(DTA can)
The 32-Bit Checkbox: Tells DMorf whether to create 24-bit or
32-bit TGA files. The only reason you might want to
use 32-bit TGA files is if you're planning to do compositing.
Some programs can only read 24-bit TGA files. (DTA can read
either)
The Bottom-to-Top Checkbox: Tells DMorf whether to create
TGA files that begin at the bottom of the screen, or at the
top of the screen. Some programs can only read one or
the other variety. (DTA can read both, but prefers bottom-to
top)
The Mesh colors "R" control: sets the red component of the color
used to display the control mesh.
The Mesh colors "G" control: sets the green component of the color
used to display the control mesh.
The Mesh colors "B" control: sets the blue component of the color
used to display the control mesh.
The Frames control: tells DMorf how many pictures to create.
If you're in Morph mode, then this represents how many tween
frames to create. In warp mode, this number includes a
fully-warped final frame.
The Swap button: swaps the meshes between the two windows.
The Copy 1->2 button: copies the mesh from window 1 into
window 2.
The Copy 2->1 button: copies the mesh from window 2 into
window 1.
The Mirror 1 button: flips the mesh in window 1 horizontally.
The Mirror 2 button: flips the mesh in window 2 horizontally.
The Splines button: gives you a preview of what splines for the
current mesh points would look like. If you're using
"Spline meshes" mode, make sure you use this button once in a
while to make sure the splines aren't going nuts.
The Zoom buttons: display just one of the images, much larger.
This gives much finer control over the mesh control points.
The Save button: saves your meshes and settings to a control file.
The Load button: loads a control file. Type the filename right the
first time or you'll get a run-time error and get dumped out to
DOS.
The Go button: causes DMorf to start morphing.
The Abort button: Changed my mind. Get me out of this program NOW.
The escape key does the same thing.
If all this makes no sense, just start messing around with the
program. Once you figure out how to add new points to the mesh,
the rest of the interface is pretty intuitive.
----------------------------------------------------------------------
Credits:
The warping, morphing, image scaling, and spline algorithms all
come (with modification) from George Wolberg's excellent book
Digital Image Warping. The user interface stuff is all mine.
Thanks to Michael Day (Knight Software) for making his VESA
BGI graphics driver (BGI256) available.
Thanks to the Compuserve GRAPHDEV forum gang, and the Graphics
Alternative BBS gang for their suggestions, and various bugs
they've helped me identify.
----------------------------------------------------------------------
Disclaimer:
If you use DMorf, you do so at your own risk. I won't be held
responsible if it screws anything up.
----------------------------------------------------------------------
Support:
If you've got any requests/bug reports/suggestions, send a message
to:
"David Mason" on the "You Can Call Me Ray" BBS, (708) 358-5611,
and on "The Graphics Alternative", (510) 524-2780,
and on "Channel 1" BBS, (617) 354-8873.
"76546,1321" on Compuserve.
You'll probably get some kind of a response (maybe sooner, maybe
later)
----------------------------------------------------------------------
Money matters:
DMorf is a shareware program. If you think this program is worth
it, send some money or some computer hardware or something to:
David K. Mason
P.O. Box 181015
Boston, MA 02118
I think $35 is an appropriate amount, but feel free to send more
or less.